<?php

namespace App\Http\Requests\Promo;

use App\Http\Requests\ApiRequest;

/**
 * @property string appid
 * @property string openid
 * @property string media_id
 * @property int id
 * @property string type
 * @property mixed bos_url
 */
class PromoPicUrlRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'appid'    => 'required|string',
            'openid'   => 'required|string',
            'media_id' => 'required|string',
            'bos_url'  => 'nullable|url',
        ];
    }

    /**
     * @return array
     */
//    public function messages()
//    {
//        return [
//            'appid.*'    => '公众号的appid必须是字符串',
//            'openid.*'   => '微信用户的openid必须是字符串',
//            'media_id.*' => '图片的media_id必须是字符串',
//            'bos_url'    => '图片的地址是url',
//        ];
//    }
}
